// src/utils/routeGuards.js
export const getRedirectPath = (userType, isProfileCompleted) => {
  // 如果信息未完善，跳转到完善页面
  if (!isProfileCompleted) {
    if (userType === 'student') {
      return '/complete-profile/student'
    } else if (userType === 'teacher') {
      return '/complete-profile/teacher'
    }
  }
  
  // 信息已完善，跳转到对应的仪表盘
  if (userType === 'teacher') {
    return '/teacher/dashboard'
  } else if (userType === 'student') {
    return '/student/dashboard'
  } else {
    return '/dashboard' // admin
  }
}

export const shouldRedirectToProfile = (userType, isProfileCompleted, currentPath) => {
  // 如果当前就在完善信息页面，不需要重定向
  if (currentPath.startsWith('/complete-profile/')) {
    return false
  }
  
  // 检查是否需要完善信息
  return !isProfileCompleted && (userType === 'student' || userType === 'teacher')
}